﻿namespace Actya.Core.Infrastructure.Events
{
	/// <summary>
	/// Event listener marker interface (for IoC convenience).
	/// </summary>
	public interface IEventListener
	{}

	/// <summary>
	/// Event listener interface that is parameterized with the type of the payload (event data). See also Credits.txt.
	/// </summary>
	/// <typeparam name="TPayload"></typeparam>
	public interface IEventListener<in TPayload> : IEventListener where TPayload: class 
	{
		/// <summary>
		/// Handle the published event with the given payload as event data.
		/// </summary>
		/// <param name="payload"></param>
		void Handle(TPayload payload);
	}
}
